var FileSaver = require('file-saver');


export default (data, name) => {
  var content = JSON.stringify(data);
  var blob = new Blob([content], {
    type: "text/plain;charset=utf-8"
  });
  let jsonName = name ? name + ".json" : new Date().getTime() + ".json"
  FileSaver.saveAs(blob, jsonName);
}
